﻿@{
    Layout = "~/Views/Shared/_FormGray.cshtml";
}

<div class="row animated fadeInRight">
    <div class="ibox float-e-margins">
        <div id="ibox-content">
            <div id="vertical-timeline" class="vertical-container light-timeline">
                <div class="vertical-timeline-block">
                    <div class="vertical-timeline-icon navy-bg">
                        <i class="fa fa-briefcase"></i>
                    </div>

                    <div class="vertical-timeline-content">
                        <h2>规划档案迁移</h2>
                        <p>将老系统中的规划档案资料，迁移到新系统的数据库中</p>
                        <a class="btn btn-sm btn-primary" onclick="importData(1)"> 开始导入</a>
                    </div>
                </div>

                <div class="vertical-timeline-block">
                    <div class="vertical-timeline-icon blue-bg">
                        <i class="fa fa-file-text"></i>
                    </div>

                    <div class="vertical-timeline-content">
                        <h2>国土档案迁移</h2>
                        <p>将老系统中的国土档案资料，迁移到新系统的数据库中</p>
                        <a class="btn btn-sm btn-primary" onclick="importData(2)"> 开始导入</a>
                    </div>
                </div>

                <div class="vertical-timeline-block">
                    <div class="vertical-timeline-icon lazur-bg">
                        <i class="fa fa-coffee"></i>
                    </div>

                    <div class="vertical-timeline-content">
                        <h2>房屋档案迁移</h2>
                        <p>将老系统中的房屋档案资料，迁移到新系统的数据库中</p>
                        <a class="btn btn-sm btn-primary" onclick="importData(3)"> 开始导入</a>
                    </div>
                </div>

                <div class="vertical-timeline-block">
                    <div class="vertical-timeline-icon yellow-bg">
                        <i class="fa fa-phone"></i>
                    </div>

                    <div class="vertical-timeline-content">
                        <h2>文书档案迁移</h2>
                        <p>将老系统中的文书档案资料，迁移到新系统的数据库中</p>
                        <a class="btn btn-sm btn-primary" onclick="importData(4)"> 开始导入</a>
                    </div>
                </div>

                <div class="vertical-timeline-block">
                    <div class="vertical-timeline-icon lazur-bg">
                        <i class="fa fa-user-md"></i>
                    </div>

                    <div class="vertical-timeline-content">
                        <h2>物业、园区、招投标档案迁移</h2>
                        <p>将老系统中的物业、园区、招投标档案资料，迁移到新系统的数据库中</p>
                        <a class="btn btn-sm btn-primary" onclick="importData(5)"> 开始导入</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">

    /**
     *
    id: 用来识别是要导入什么档案
        1:规划档案； 2:国土档案； 3：房屋档案； 4：文书档案； 5：物业、园区、招投标档案
     */
    function importData(id) {
        var category;
        switch (id) {
            case 1: category = "规划档案"; break;
            case 2: category = "国土档案"; break;
            case 3: category = "房屋档案"; break;
            case 4: category = "文书档案"; break;
            case 5: category = "物业、园区、招投标档案"; break;
        }
        ys.confirm("确认要导入" + category + "吗？", function () {
            ys.ajax({
                url: '@Url.Content("~/DataManage/Migration/ImportData")' + '?id=' + id,
                type: "post",
                success: function (obj) {
                    if (obj.Tag == 1) {
                        ys.msgSuccess(obj.Message);
                    }
                    else {
                        ys.msgError(obj.Message);
                    }
                }
            });
        })
    }

</script>